#include "InputHandle.h"

void InputHandle::processInput(GLFWwindow* window)
{
	
}

void InputHandle::Init(GLFWwindow* window)
{
	p_window = window;

	glfwSetInputMode(p_window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
}

void InputHandle::Update(float dTime)
{
	
}

void InputHandle::ShowOrHideCursor(bool isShow) const
{
	if (isShow)
	{
		glfwSetInputMode(p_window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
	}
	else
	{
		glfwSetInputMode(p_window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
	}
}

void InputHandle::SetCursorPos(double x, double y) const
{
	glfwSetCursorPos(p_window, x, y);
}

glm::vec2 InputHandle::GetCursorPos() const
{
	glm::vec2 cursorPos;
	double x = 0;
	double y = 0;
	glfwGetCursorPos(p_window, &x, &y);
	cursorPos.x =  x;
	cursorPos.y = y;
	return cursorPos;
}
